<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /* let a = 1;
    let b = a;
    b = 2;

    console.log("{a, b}", { a, b });

    let c = { name: "shengjingyin" };
    let d = c;
    d.name = "juliya";

    console.log("c: ", c);
    console.log("d: ", d); */
    /* let c = { name: "shengjingyin" };
    let d = Object.assign({}, c);
    d.name = "juliya"; */

    /* let c = { name: "shengjingyin", habit: ["篮球", "游泳"] };
    let d = JSON.parse(JSON.stringify(c));
    d.habit.push("code"); */

    // let a = [[1, 2], 2, 3, 4];
    // let b = a.slice(); // < 等-价 >   let b = a.concat()
    // b[0][0] = 10;
    // b[1] = 20;
    // console.log("b", a); //  [[10, 2], 2, 3, 4]F
    // console.log("b", b); //  [[10, 2], 2, 3, 4]F

    // let obj = {
    //   name: "shengjingyin",
    //   cc: {
    //     name: "juliya",
    //   },
    // };
    // let newObj = Object.assign({}, obj);

    // obj.name = "juliya";
    // obj.cc.name = "juliya";
    // console.log("obj", obj);
    // console.log("newObj", newObj);

    // let obj = {
    //   name: "shengjingyin",
    //   cc: {
    //     name: "juliya",
    //   },
    // };
    // let newObj = { ...obj };

    // obj.name = "juliya";
    // obj.cc.name = "juliya";
    // console.log("obj", obj);
    // console.log("newObj", newObj);

    let a = [[1, 2], 2, 3, 4];
    let b = JSON.parse(JSON.stringify(a));
    a[0][0] = 5;
    a[1] = 20;

    console.log("a", a); //  [[10, 2], 2, 3, 4]F
    console.log("b", b); //  [[10, 2], 2, 3, 4]F
  </script>
</html>
